Skip to content

fix: fill missing fully qualified syntax in prompt_handler macros#866

Open
moroviintaas wants to merge 1 commit into
modelcontextprotocol:mainfrom
moroviintaas:fix_ufcs_prompt_handler
Open

fix: fill missing fully qualified syntax in prompt_handler macros#866
moroviintaas wants to merge 1 commit into
modelcontextprotocol:mainfrom
moroviintaas:fix_ufcs_prompt_handler

Conversation

@moroviintaas
Copy link
Copy Markdown

Motivation and Context

Some syntax generated by macro #[prompt_handler] was not fully qualified.
I needed to use them in my user code, so the macro does not break. This include:

  • rmcp::model::GetPromptResult
  • rmcp::modelListPromptsResult
  • rmcp::model::PaginatedRequestParams
  • rmcp::RoleServer
  • rmcp::service::RequestContext

How Has This Been Tested?

  1. Modified locally examples/servers/src/common/counter.rs, removing imports from rmcp - fully qualified broken idents in examples.
  2. Checked that build fails, because missing types with hint to import them.
 cargo test --workspace --examples --features server --features client
  1. Applied this fix.
  2. Checked that tests finish with success:
cargo test --workspace --examples --features server --features client

Breaking Changes

This commit probably does not introduce braking changes.
I haven't changed macros that use McpError, which is then imported in examples with rmcp::ErrorData as McpError.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

It seems there are still some macro code that forces user to import:

use rmcp::ErrorData as McpError

but I am not sure if fixing it would not be a breaking change.

@moroviintaas moroviintaas requested a review from a team as a code owner June 1, 2026 13:16
@github-actions github-actions Bot added the T-macros Macro changes label Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-macros Macro changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant